<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <script src="jquery.js" charset="utf-8"></script>
    <script>
    let p1=new Promise(function (resolve, reject){
      $.ajax({
        url: 'data/arr.txt',
        dataType: 'json',
        success(arr){
          resolve(arr);
        },
        error(err){
          reject(err);
        }
      })
    });
    let p2=new Promise(function (resolve, reject){
      $.ajax({
        url: 'data/json.txt',
        dataType: 'json',
        success(arr){
          resolve(arr);
        },
        error(err){
          reject(err);
        }
      })
    });

    Promise.all([
      p1, p2
    ]).then(function (arr){
      let [res1, res2]=arr;

      alert('全都成功了');
      alert(res1);
      alert(res2);
    }, function (){
      alert('至少有一个失败了');
    });
    </script>
  </head>
  <body>

  </body>
</html>
